<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <title>(o゜▽゜)o☆</title>
    <link rel="stylesheet" href="../lotteryticket/css/index.css">
</head>
<body>
<div id="container">
    <button class="light-btn" style="margin-top: 500px" v-on:click="composeDb" v-bind:style="{display:display}">双色球</button>
    <button class="light-btn" v-on:click="composeDf" v-bind:style="{display:display}">大乐透</button>
    <button class="light-btn" v-on:click="compose" v-bind:style="{display:display}">双色球&&大乐透</button>
    <div v-if="dbList.length !== 0" style="padding-top: 100px;width: 800px">
        <p class="d">双色球</p>
        <div v-for="list of dbList" style="display: flex;flex-direction: row;justify-content: center">
            <div class="red">{{list[0]}}</div>
            <div class="red">{{list[1]}}</div>
            <div class="red">{{list[2]}}</div>
            <div class="red">{{list[3]}}</div>
            <div class="red">{{list[4]}}</div>
            <div class="red">{{list[5]}}</div>
            <div class="blue" style="padding-left: 30px">{{list[6]}}</div>
        </div>
    </div>
    <div v-if="dfList.length !== 0" style="padding-top: 100px;width: 800px">
        <p class="d">大乐透</p>
        <div v-for="list of dfList" style="display: flex;flex-direction: row;justify-content:center">
            <div class="red">{{list[0]}}</div>
            <div class="red">{{list[1]}}</div>
            <div class="red">{{list[2]}}</div>
            <div class="red">{{list[3]}}</div>
            <div class="red">{{list[4]}}</div>
            <div class="blue" style="padding-left: 30px">{{list[5]}}</div>
            <div class="blue">{{list[6]}}</div>
        </div>
    </div>
</div>
<script src="../lotteryticket/js/vue.min.js"></script>
<script src="../lotteryticket/js/axios.min.js"></script>
<script>
    new Vue({
        el: "#container",
        data: {
            dbList: [],
            dfList: [],
            display: '',
        },
        methods: {
            composeDb: function(){
                this.display = 'none';
                axios({
                    method: "GET",
                    url: "/lotteryticket/composeDb",
                }).then(res => {
                    this.dbList = res.data;
                });
            },
            composeDf: function(){
                this.display = 'none';
                axios({
                    method: "GET",
                    url: "/lotteryticket/composeDf",
                }).then(res => {
                    this.dfList = res.data;
                });
            },
            compose: async function () {
                this.composeDb();
                this.composeDf();
            },
        }
    });
</script>
</body>
</html>